package com.zdxk.msgPush.stockMsg.subscribe;

import com.zdxk.msgPush.common.rocket.consume.IMsgHandler;
import com.zdxk.msgPush.common.thread.ExecutorProcessPool;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.common.message.MessageExt;

import java.util.List;

public class StockTradeMsgHandler implements IMsgHandler {

    @Override
    public void dealMsg(List<MessageExt> list, ConsumeConcurrentlyContext consumeConcurrentlyContext) {
        for (MessageExt msg : list){
            ExecutorProcessPool.getInstance().execute(()->{
                System.out.printf(msg.getBornHostNameString());
            });
        }
    }
}
